cmake_minimum_required(VERSION 2.8)

project(icuin)

include_directories(
    ../common
)

set(ICUIN_SOURCE_FILES
    alphaindex.cpp
    bocsu.cpp
    coleitr.cpp
    coll.cpp
    region.cpp
    search.cpp
    sortkey.cpp
    stsearch.cpp
    tblcoll.cpp
    tzfmt.cpp
    tzgnames.cpp
    tznames.cpp
    tznames_impl.cpp
    ucol.cpp
    ucol_bld.cpp
    ucol_cnt.cpp
    ucol_elm.cpp
    ucol_res.cpp
    ucol_sit.cpp
    ucol_tok.cpp
    ucol_wgt.cpp
    ucoleitr.cpp
    usearch.cpp
    astro.cpp
    basictz.cpp
    buddhcal.cpp
    calendar.cpp
    cecal.cpp
    chnsecal.cpp
    choicfmt.cpp
    compactdecimalformat.cpp
    coptccal.cpp
    curramt.cpp
    currfmt.cpp
    currpinf.cpp
    currunit.cpp
    dangical.cpp
    datefmt.cpp
    dcfmtsym.cpp
    decContext.c
    decfmtst.cpp
    decimfmt.cpp
    decNumber.c
    digitlst.cpp
    dtfmtsym.cpp
    dtitvfmt.cpp
    dtitvinf.cpp
    dtptngen.cpp
    dtrule.cpp
    ethpccal.cpp
    fmtable.cpp
    fmtable_cnv.cpp
    format.cpp
    fphdlimp.cpp
    fpositer.cpp
    gender.cpp
    gregocal.cpp
    gregoimp.cpp
    hebrwcal.cpp
    identifier_info.cpp
    indiancal.cpp
    islamcal.cpp
    japancal.cpp
    locdspnm.cpp
    measfmt.cpp
    measure.cpp
    msgfmt.cpp
    nfrs.cpp
    nfrule.cpp
    nfsubs.cpp
    numfmt.cpp
    numsys.cpp
    olsontz.cpp
    persncal.cpp
    plurfmt.cpp
    plurrule.cpp
    rbnf.cpp
    rbtz.cpp
    reldtfmt.cpp
    selfmt.cpp
    simpletz.cpp
    scriptset.cpp
    smpdtfmt.cpp
    smpdtfst.cpp
    taiwncal.cpp
    timezone.cpp
    tmunit.cpp
    tmutamt.cpp
    tmutfmt.cpp
    tzrule.cpp
    tztrans.cpp
    ucal.cpp
    ucurr.cpp
    udat.cpp
    udateintervalformat.cpp
    udatpg.cpp
    ulocdata.c
    umsg.cpp
    unum.cpp
    upluralrules.cpp
    utmscale.c
    vtzone.cpp
    vzone.cpp
    windtfmt.cpp
    winnmfmt.cpp
    wintzimpl.cpp
    zonemeta.cpp
    zrule.cpp
    ztrans.cpp
    ucln_in.c
    regexcmp.cpp
    regeximp.cpp
    regexst.cpp
    regextxt.cpp
    rematch.cpp
    repattrn.cpp
    uregex.cpp
    uregexc.cpp
    anytrans.cpp
    brktrans.cpp
    casetrn.cpp
    cpdtrans.cpp
    esctrn.cpp
    funcrepl.cpp
    name2uni.cpp
    nortrans.cpp
    nultrans.cpp
    quant.cpp
    rbt.cpp
    rbt_data.cpp
    rbt_pars.cpp
    rbt_rule.cpp
    rbt_set.cpp
    remtrans.cpp
    strmatch.cpp
    strrepl.cpp
    titletrn.cpp
    tolowtrn.cpp
    toupptrn.cpp
    translit.cpp
    transreg.cpp
    tridpars.cpp
    unesctrn.cpp
    uni2name.cpp
    utrans.cpp
    csdetect.cpp
    csmatch.cpp
    csr2022.cpp
    csrecog.cpp
    csrmbcs.cpp
    csrsbcs.cpp
    csrucode.cpp
    csrutf8.cpp
    inputext.cpp
    ucsdet.cpp
    uspoof.cpp
    uspoof_build.cpp
    uspoof_conf.cpp
    uspoof_impl.cpp
    uspoof_wsconf.cpp
)

set(ICUIN_HEADER_FILES
    bocsu.h
    dcfmtimp.h
    numsys_impl.h
    region_impl.h
    selfmtimpl.h
    tzgnames.h
    tznames_impl.h
    ucol_bld.h
    ucol_cnt.h
    ucol_elm.h
    ucol_imp.h
    ucol_tok.h
    ucol_wgt.h
    unicode/region.h
    usrchimp.h
    astro.h
    buddhcal.h
    cecal.h
    chnsecal.h
    coptccal.h
    currfmt.h
    dangical.h
    decContext.h
    decfmtst.h
    decNumber.h
    decNumberLocal.h
    digitlst.h
    dtitv_impl.h
    dtptngen_impl.h
    ethpccal.h
    fphdlimp.h
    gregoimp.h
    hebrwcal.h
    indiancal.h
    islamcal.h
    japancal.h
    msgfmt_impl.h
    nfrlist.h
    nfrs.h
    nfrule.h
    nfsubs.h
    olsontz.h
    persncal.h
    plurrule_impl.h
    reldtfmt.h
    smpdtfst.h
    taiwncal.h
    ucurrimp.h
    umsg_imp.h
    vzone.h
    windtfmt.h
    winnmfmt.h
    wintzimpl.h
    zonemeta.h
    zrule.h
    ztrans.h
    ucln_in.h
    regexcmp.h
    regexcst.h
    regeximp.h
    regexst.h
    regextxt.h
    anytrans.h
    brktrans.h
    casetrn.h
    cpdtrans.h
    esctrn.h
    funcrepl.h
    name2uni.h
    nortrans.h
    nultrans.h
    quant.h
    rbt.h
    rbt_data.h
    rbt_pars.h
    rbt_rule.h
    rbt_set.h
    remtrans.h
    strmatch.h
    strrepl.h
    titletrn.h
    tolowtrn.h
    toupptrn.h
    transreg.h
    tridpars.h
    unesctrn.h
    uni2name.h
    csdetect.h
    csmatch.h
    csr2022.h
    csrecog.h
    csrmbcs.h
    csrsbcs.h
    csrucode.h
    csrutf8.h
    inputext.h
    identifier_info.h
    scriptset.h
    uspoof_conf.h
    uspoof_impl.h
    uspoof_wsconf.h
)

source_group("charset detect" FILES 
    csdetect.cpp
    csmatch.cpp
    csr2022.cpp
    csrecog.cpp
    csrmbcs.cpp
    csrsbcs.cpp
    csrucode.cpp
    csrutf8.cpp
    inputext.cpp
    ucsdet.cpp
    csdetect.h
    csmatch.h
    csr2022.h
    csrecog.h
    csrmbcs.h
    csrsbcs.h
    csrucode.h
    csrutf8.h
    inputext.h
)
source_group("collation" FILES 
    coleitr.cpp
    coll.cpp
    search.cpp
    sortkey.cpp
    stsearch.cpp
    tblcoll.cpp
    ucol.cpp
    ucol_bld.cpp
    ucol_cnt.cpp
    ucol_elm.cpp
    ucol_res.cpp
    ucol_sit.cpp
    ucol_tok.cpp
    ucol_wgt.cpp
    ucoleitr.cpp
    usearch.cpp
    alphaindex.cpp
    bocsu.h
    ucol_bld.h
    ucol_cnt.h
    ucol_elm.h
    ucol_imp.h
    ucol_tok.h
    ucol_wgt.h
    usrchimp.h
)
source_group("transforms" FILES 
    anytrans.cpp
    brktrans.cpp
    casetrn.cpp
    cpdtrans.cpp
    esctrn.cpp
    funcrepl.cpp
    name2uni.cpp
    nortrans.cpp
    nultrans.cpp
    quant.cpp
    rbt.cpp
    rbt_data.cpp
    rbt_pars.cpp
    rbt_rule.cpp
    rbt_set.cpp
    remtrans.cpp
    strmatch.cpp
    strrepl.cpp
    titletrn.cpp
    tolowtrn.cpp
    toupptrn.cpp
    translit.cpp
    transreg.cpp
    tridpars.cpp
    unesctrn.cpp
    uni2name.cpp
    utrans.cpp
    bocsu.cpp
    anytrans.h
    brktrans.h
    casetrn.h
    cpdtrans.h
    esctrn.h
    funcrepl.h
    name2uni.h
    nortrans.h
    nultrans.h
    quant.h
    rbt.h
    rbt_data.h
    rbt_pars.h
    rbt_rule.h
    rbt_set.h
    remtrans.h
    strmatch.h
    strrepl.h
    titletrn.h
    tolowtrn.h
    toupptrn.h
    transreg.h
    tridpars.h
    unesctrn.h
    uni2name.h
)
source_group("regex" FILES 
    regexcmp.cpp
    regeximp.cpp
    regexst.cpp
    regextxt.cpp
    rematch.cpp
    repattrn.cpp
    uregex.cpp
    uregexc.cpp
    regexcmp.h
    regexcst.h
    regeximp.h
    regexst.h
    regextxt.h
)
source_group("misc" FILES 
    ucln_in.c
    ucln_in.h
)
source_group("formatting" FILES 
    astro.cpp
    basictz.cpp
    buddhcal.cpp
    calendar.cpp
    cecal.cpp
    chnsecal.cpp
    choicfmt.cpp
    coptccal.cpp
    curramt.cpp
    currfmt.cpp
    currpinf.cpp
    currunit.cpp
    dangical.cpp
    datefmt.cpp
    dcfmtsym.cpp
    decContext.c
    decfmtst.cpp
    decimfmt.cpp
    decNumber.c
    digitlst.cpp
    dtfmtsym.cpp
    dtitvfmt.cpp
    dtitvinf.cpp
    dtptngen.cpp
    dtrule.cpp
    ethpccal.cpp
    fmtable.cpp
    fmtable_cnv.cpp
    format.cpp
    fphdlimp.cpp
    fpositer.cpp
    gender.cpp
    gregocal.cpp
    gregoimp.cpp
    hebrwcal.cpp
    indiancal.cpp
    islamcal.cpp
    japancal.cpp
    locdspnm.cpp
    measfmt.cpp
    measure.cpp
    msgfmt.cpp
    nfrs.cpp
    nfrule.cpp
    nfsubs.cpp
    numfmt.cpp
    numsys.cpp
    olsontz.cpp
    persncal.cpp
    plurfmt.cpp
    plurrule.cpp
    rbnf.cpp
    rbtz.cpp
    reldtfmt.cpp
    selfmt.cpp
    simpletz.cpp
    smpdtfmt.cpp
    smpdtfst.cpp
    taiwncal.cpp
    timezone.cpp
    tmunit.cpp
    tmutamt.cpp
    tmutfmt.cpp
    tzrule.cpp
    tztrans.cpp
    ucal.cpp
    ucurr.cpp
    udat.cpp
    udateintervalformat.cpp
    udatpg.cpp
    ulocdata.c
    umsg.cpp
    unum.cpp
    upluralrules.cpp
    utmscale.c
    vtzone.cpp
    vzone.cpp
    windtfmt.cpp
    winnmfmt.cpp
    wintzimpl.cpp
    zonemeta.cpp
    zrule.cpp
    ztrans.cpp
    tzfmt.cpp
    tzgnames.cpp
    tznames.cpp
    tznames_impl.cpp
    compactdecimalformat.cpp
    region.cpp
    astro.h
    buddhcal.h
    cecal.h
    chnsecal.h
    coptccal.h
    currfmt.h
    dangical.h
    decContext.h
    decfmtst.h
    decNumber.h
    decNumberLocal.h
    digitlst.h
    dtitv_impl.h
    dtptngen_impl.h
    ethpccal.h
    fphdlimp.h
    gregoimp.h
    hebrwcal.h
    indiancal.h
    islamcal.h
    japancal.h
    msgfmt_impl.h
    nfrlist.h
    nfrs.h
    nfrule.h
    nfsubs.h
    olsontz.h
    persncal.h
    plurrule_impl.h
    reldtfmt.h
    smpdtfst.h
    taiwncal.h
    ucurrimp.h
    umsg_imp.h
    vzone.h
    windtfmt.h
    winnmfmt.h
    wintzimpl.h
    zonemeta.h
    zrule.h
    ztrans.h
    tzgnames.h
    tznames_impl.h
    numsys_impl.h
    dcfmtimp.h
    selfmtimpl.h
    region_impl.h
    unicode/region.h
)
source_group("spoof" FILES 
    identifier_info.cpp
    scriptset.cpp
    uspoof.cpp
    uspoof_build.cpp
    uspoof_conf.cpp
    uspoof_impl.cpp
    uspoof_wsconf.cpp
    identifier_info.h
    scriptset.h
    uspoof_conf.h
    uspoof_impl.h
    uspoof_wsconf.h
)


set_source_files_properties(ICUIN_HEADER_FILES
                            PROPERTIES HEADER_FILE_ONLY TRUE)
list(APPEND ICUIN_SOURCE_FILES ${ICUIN_HEADER_FILES})

add_definitions(
    -DU_ATTRIBUTE_DEPRECATED=
    -DU_I18N_IMPLEMENTATION
)

add_library(icuin SHARED ${ICUIN_SOURCE_FILES} )
target_link_libraries(icuin icuuc)

install(TARGETS icuin
        RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
        ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
        LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
install(DIRECTORY ${PROJECT_SOURCE_DIR}/unicode
        DESTINATION "${INSTALL_INC_DIR}" FILES_MATCHING PATTERN "*.h")

